#include<bits/stdc++.h>
#define XH(i,a,b) for(int i=a;i<b;++i)
#define XXH(i,a,b) for(int i=a-1;i>=b;--i)
#define LL long long
using namespace std;
int tmpINT; string tmpSTRING; char tmpCHAR; double tmpDOUBLE; LL tmpLONGLONG;

struct node
{
	LL price;
};

bool cmp(node a,node b){
	return a.a<b.a;
}

void solve(){
	LL A,B,n;scanf("%I64d%I64d%I64d", &A,&B,&n);
	node monster[n];
	XH(i , 0 , n)scanf("%I64d", &monster[i].a);
	XH(i , 0 , n)scanf("%I64d", &monster[i].b);
	XH(i , 0 , n){
		tmpLONGLONG = monster[i].b/A;
		if(monster[i].b%A)tmpLONGLONG++;
		monster[i].price = tmpLONGLONG*monster[i].a;
	}
	sort(monster,monster+n,cmp);
	XH(i , 0 , n-1){
		B-=monster[i].price;
		if(B<=0){
			printf("NO\n");
			return;
		}
	}
	if(B-monster[n-1].price<0){
		tmpLONGLONG = abs(B-monster[n-1].price);
		if(tmpLONGLONG>=monster[n-1].a){
			printf("NO\n");
			return;
		}
	}
	printf("YES\n");
}

int main(){
	int t; scanf("%d",&t);
	for(int i=0;i<t;++i) solve();
	
	return 0;
}